import moment from 'moment'

// 社保应付账单
export const ShouldPayableThead = [
  // {
  //   type: 'selection',
  //   minWidth: 60,
  //   align: 'center'
  // },
  {
    title: '费用月份',
    key: 'feeDate',
    width: 100,
    render: (h, params) => {
      const month = params.row.periodMonth < 10 ? '0' + params.row.periodMonth : params.row.periodMonth
      const text = params.row.periodYear + '' + month
      return h('span', text)
    }
  },
  {
    title: '社保编号',
    key: 'socialSecurityNo',
    minWidth: 150
  },
  {
    title: '编号所属单位',
    key: 'unitName',
    minWidth: 150
  },
  {
    title: '养老应付',
    key: 'Pensionshould',
    minWidth: 150
  },
  {
    title: '医疗应付',
    key: 'MedicalCareshould',
    minWidth: 150
  },
  {
    title: '失业应付',
    key: 'Unemploymentshould',
    minWidth: 150
  },
  {
    title: '工伤应付',
    key: 'InjuryOnTheJobshould',
    minWidth: 150
  },
  {
    title: '生育应付',
    key: 'Birthshould',
    minWidth: 150
  },
  {
    title: '大病应付',
    key: 'SeriousIllnessshould',
    minWidth: 150
  },
  {
    title: '残保金应付',
    key: 'DisabledPersonsSecurityFundshould',
    minWidth: 150
  },
  {
    title: '门诊医疗应付',
    key: 'OutpatientDepartmentshould',
    minWidth: 150
  },
  {
    title: '服务费应付',
    key: 'ServiceChargeshould',
    minWidth: 150
  },
  {
    title: '其他费用应付',
    key: 'OtherExpensesshould',
    minWidth: 150
  },
  {
    title: '应付总计',
    key: 'total',
    minWidth: 150
  },
  {
    title: '应收总计',
    key: 'shouldTotal',
    minWidth: 150
  },
  {
    title: '实到总计',
    key: 'trueTotal',
    minWidth: 150
  },
  {
    title: '实付金额合计',
    key: 'payableTotal',
    minWidth: 150
  },
  // {
  //   title: '付款人',
  //   key: 'payUser',
  //   minWidth: 150
  // },
  // {
  //   title: '付款银行',
  //   key: 'payBank',
  //   minWidth: 150
  // },
  // {
  //   title: '付款时间',
  //   key: 'payDate',
  //   render: (h, params) => {
  //     let row = params.row
  //     let times = ''
  //     if (row.payDate) {
  //       times = row.payDate.slice(0, 10).replace(/T/g, ' ')
  //     }
  //     return h('span', times)
  //   },
  //   minWidth: 150
  // },
  {
    title: '状态',
    key: 'status',
    minWidth: 150
  },
  {
    title: '操作',
    key: 'action',
    slot: 'action',
    width: 420,
    fixed: 'right',
    align: 'center'
  }
]

// 展开表格
export const ShouldPayableChildrenThead = [
  // {
  //   type: 'selection',
  //   minWidth: 60,
  //   align: 'center'
  // },
  {
    title: '费用月份',
    key: 'feeDate',
    tooltip: true,
    render: (h, params) => {
      const month = params.row.periodMonth < 10 ? '0' + params.row.periodMonth : params.row.periodMonth
      const text = params.row.periodYear + '' + month
      return h('span', text)
    },
    minWidth: 150
  },
  {
    title: '社保编号',
    key: 'socialSecurityNo',
    tooltip: true,
    minWidth: 150
  },
  {
    title: '客户名称',
    key: 'customerName',
    tooltip: true,
    minWidth: 150
  },
  {
    title: '养老应付',
    key: 'Pensionshould',
    tooltip: true,
    minWidth: 150
  },
  {
    title: '医疗应付',
    key: 'MedicalCareshould',
    tooltip: true,
    minWidth: 150
  },
  {
    title: '失业应付',
    key: 'Unemploymentshould',
    tooltip: true,
    minWidth: 150
  },
  {
    title: '工伤应付',
    key: 'InjuryOnTheJobshould',
    tooltip: true,
    minWidth: 150
  },
  {
    title: '生育应付',
    key: 'Birthshould',
    tooltip: true,
    minWidth: 150
  },
  {
    title: '大病应付',
    key: 'SeriousIllnessshould',
    tooltip: true,
    minWidth: 150
  },
  {
    title: '残保金应付',
    key: 'DisabledPersonsSecurityFundshould',
    tooltip: true,
    minWidth: 150
  },
  {
    title: '门诊医疗应付',
    key: 'OutpatientDepartmentshould',
    tooltip: true,
    minWidth: 150
  },
  {
    title: '服务费应付',
    key: 'ServiceChargeshould',
    tooltip: true,
    minWidth: 150
  },
  {
    title: '其他费用应付',
    key: 'OtherExpensesshould',
    tooltip: true,
    minWidth: 150
  },
  {
    title: '备注',
    key: 'OtherExpensesremark',
    tooltip: true,
    minWidth: 150
  },
  // {
  //   title: '应付总计',
  //   key: 'total',
  //   tooltip: true
  // },
  {
    title: '应付总计',
    key: 'total',
    minWidth: 150
  },
  {
    title: '应收总计',
    key: 'shouldTotal',
    minWidth: 150
  },
  {
    title: '实到总计',
    key: 'trueTotal',
    minWidth: 150
  },
  // {
  //   title: '操作',
  //   key: 'action',
  //   slot: 'action',
  //   width: 260,
  //   fixed: 'right',
  //   align: 'center'
  // }
]

// 查看付款
export const PayListThead = [
  // {
  //   type: 'selection',
  //   minWidth: 60,
  //   align: 'center'
  // },
  {
    title: '账号名称',
    key: 'accountName',
    tooltip: true,
    minWidth: 150
  },
  {
    title: '开户行',
    key: 'accountBank',
    tooltip: true,
    minWidth: 150
  },
  {
    title: '收款账号',
    key: 'accountNo',
    tooltip: true,
    minWidth: 150
  },
  {
    title: '付款方式',
    key: 'payType',
    tooltip: true,
    minWidth: 150
  },
  {
    title: '请款金额',
    key: 'applyTotal',
    tooltip: true,
    minWidth: 150
  },
  {
    title: '付款说明',
    key: 'remark',
    tooltip: true,
    minWidth: 150
  },
  {
    title: '付款人',
    key: 'payUser',
    tooltip: true,
    minWidth: 150
  },
  {
    title: '付款金额',
    key: 'total',
    tooltip: true,
    minWidth: 150
  },
  {
    title: '付款时间',
    key: 'payDate',
    tooltip: true,
    minWidth: 150,
    render: (h, params) => {
      const text = params.row.payDate ? moment(params.row.payDate).format('YYYY-MM-DD') : ''
      return h('span', text)
    }
  },
  {
    title: '付款银行',
    key: 'payBank',
    tooltip: true,
    minWidth: 150
  },
]